/******************************************************************************
 * Variables
 *****************************************************************************/

@serif: georgia, serif;
@sans: verdana, sans-serif;
@phpPurple: #8892BF;
@phpPurpleDark: #4F5B93;

/******************************************************************************
 * Basics
 *****************************************************************************/

*{
    box-sizing: border-box;
}

body{
    font-size: 24px;
    line-height: 32px;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4{
    font-family: @serif;
}

h1, .alpha{
    position: relative;
    font-size: 48px;
    font-weight: normal;
    line-height: 50px;
    text-align: center;
}

h2, .beta{
    font-size: 32px;
    font-weight: normal;
    line-height: 36px;
}

h3, .gamma{
    font-size: 24px;
    font-weight: bold;
    line-height: 30px;
}

blockquote{
    border-left: 3px solid #CCC;
    padding-left: 20px;
    color: #777;
    font-style: italic;
    word-wrap: break-word;
}

a{
    color: @phpPurpleDark;

    &:hover{
        color: @phpPurple;
    }
}

.back-to-top{
    text-align: center;

    a{
        background: @phpPurpleDark;
        border-radius: 3px;
        display: inline-block;
        height: 40px;
        padding: 0 20px;
        transition: all 0.1s ease;
        color: white;
        font-family: @sans;
        font-size: 13px;
        line-height: 40px;
        text-decoration: none;
        text-transform: uppercase;

        &:hover{
            background: @phpPurple;
        }
    }
}

img{
    max-width: 100%;
}

pre, code{
    color: #444;
    font-family: "Source Code Pro", Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
    font-size: 90%;
}
a{
    pre, code{
        color: inherit;
    }
}

pre{
    background: #f7f7f7;
    border: 1px solid #EEE;
    border-radius: 3px;
    display: block;
    overflow: auto;
    padding: 20px;
    width: 100%;
}

@media (max-width: 767px) {
    body{
        font-size: 18px;
        line-height: 24px;
    }
    h1, .alpha{
        font-size: 36px;
        line-height: 38px;
    }

    h2, .beta{
        font-size: 24px;
        line-height: 28px;
    }

    h3, .gamma{
        font-size: 18px;
        line-height: 23px;
    }

    blockquote{
        margin-left: 0;
    }

    ul, ol{
        padding-left: 1em;
    }

    pre{
        padding: 5px 10px;
        white-space: pre-wrap;
        white-space: -moz-pre-wrap;
        white-space: -pre-wrap;
        white-space: -o-pre-wrap;
        word-wrap: break-word;
    }
}

@media (max-width: 360px) {
    body{
        font-size: 16px;
        line-height: 21px;
    }

    h1, .alpha{
        font-size: 28px;
        line-height: 30px;
    }

    h2, .beta{
        font-size: 20px;
        line-height: 23px;
    }

    h3, .gamma{
        font-size: 16px;
        line-height: 20px;
    }
}

/******************************************************************************
 * Header
 *****************************************************************************/

.site-header{
    padding-top: 40px;
    margin-bottom: 40px;
    text-align: center;

    h1{
        margin: 0;
        font-size: 72px;
        line-height: 60px;

        em{
            display: block;
            font-size: 34px;
            font-style: normal;
        }

        a{
            color: #333;
            text-decoration: none;

            &:hover{
                color: @phpPurple;
            }
        }
    }

    .build-date{
        margin-bottom: 10px;
        color: #999;
        font-family: @sans;
        font-size: 11px;
        text-transform: uppercase;
    }

    .btn-share{
        background: @phpPurple;
        border-radius: 3px;
        display: inline-block;
        height: 30px;
        padding: 0 20px;
        vertical-align: baseline;
        color: white;
        font-family: @sans;
        font-size: 12px;
        line-height: 30px;
        text-decoration: none;
        text-transform: uppercase;
    }

    .fork-me{
        background-image: url();
        background-position: top right;
        background-repeat: no-repeat;
        background-size: contain;
        height: 100px;
        width: 100px;
        position: absolute;
        top: 0;
        right: 0;
        z-index: 100;
        width: 120px;
    }
}

/******************************************************************************
 * Navigation
 *****************************************************************************/

.site-navigation,
.site-content,
.site-footer{
    margin: 0 auto;
    max-width: 840px;
    width: 92%;
}

.site-navigation{
    columns: 3;
    column-gap: 40px;

    input[type="checkbox"],
    label{
        display: none;
    }

    ul{
        list-style: none;
        margin: 0;
        padding: 0;

        li{
            margin-bottom: 20px;
            font-size: 22px;
            line-height: 23px;

            a{
                display: block;
                color: #444;
                font-weight: 700;
                text-decoration: none;

                &:hover{
                    color: @phpPurple;
                }
            }

            ul{
                padding-top: 8px;
            }

            li{
                margin-bottom: 6px;
                font-size: 18px;

                a{
                    border: none;
                    color: #777;
                    font-weight: normal;
                }
            }
        }
    }
    li{
        break-inside: avoid;
    }
}

@media (max-width: 820px) {
    .site-navigation{
        columns: 2;
    }
}

@media (max-width: 560px) {
    .site-navigation{
        columns: 1;
    }
}

@media (max-width: 375px) {
    .site-navigation{
        background: fade(white, 95%);
        columns: 1;
        max-height: 100vh;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 100;

        label{
            background: @phpPurpleDark;
            box-sizing: border-box;
            display: block;
            height: 40px;
            padding: 0 10px;
            width: 100vh;
            position: absolute;
            bottom: 0;
            left: 0;
            color: white;
            font-family: @sans;
            font-size: 13px;
            line-height: 40px;
            text-transform: uppercase;
            z-index: 2;
        }

        > ul{
            background: fade(white, 96%);
            border-top: 3px solid @phpPurple;
            box-shadow: fade(black, 25%) 0 -5px 10px;
            box-sizing: border-box;
            padding: 20px;
            overflow: auto;
            -webkit-overflow-scrolling: touch;
            position: absolute;
            left: 0;
            bottom: 40px;
            height: 50vh;
            width: 100vh;
            transform: translate(0,100vh);
            transition: all 0.2s ease;
            z-index: 1;
        }

        input[type="checkbox"]:checked ~ ul {
            transform: translate(0,0);
        }
    }
}

/******************************************************************************
 * Content
 *****************************************************************************/

.site-content{
    h1{
        padding-top: 40px;
        position: relative;

        &:after{
            border: 1px solid #DDD;
            border-bottom: none;
            content: "";
            display: block;
            height: 8px;
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
        }
    }

    &.chapters{
        counter-reset: chapter;

        h1{
            counter-increment: chapter;
            padding-top: 60px;

            &:before{
                display: inline-block;
                content: "Chapter " counter(chapter) ".";
                position: absolute;
                top: 30px;
                left: 50%;
                transform: translateX(-50%);
                color: #999;
                font-size: 12px;
                letter-spacing: 1px;
                line-height: 20px;
                text-transform: uppercase;
                text-align: center;
            }
        }
    }

    #welcome{
        ul{
            columns: 3;
            column-gap: 30px;
            list-style-position: inside;
        }
    }

    .back-to-top{
        margin-bottom: 60px;
    }
}

@media (max-width: 870px) {
    .site-content #welcome ul{
        columns: 2;
    }
}

@media (max-width: 600px) {
    .site-content #welcome ul{
        columns: 1;
    }
}

/******************************************************************************
 * Footer
 *****************************************************************************/

.site-footer{
    border-top: 1px solid #CCC;
    margin: 60px auto 0 auto;
    padding: 40px 20px;
    font-family: @sans;
    font-size: 16px;
    text-align: center;

    .cc-badge{
        background-image: url();
        background-position: top left;
        background-repeat: no-repeat;
        background-size: contain;
        display: inline-block;
        height: 31px;
        width: 88px;
    }

    h2{
        .gamma;
        margin-bottom: 10px;
    }

    ul{
        list-style: none;
        margin: 0 0 20px 0;
        padding: 0;
    }

    .license{
        color: #777;
        font-size: 13px;
    }
}
